import request from '@/utils/request'

// 查询一键操作配置
export function getOperation(params) {
    return request({
        url: '/marketing/farmOperate/getOneKeyOperationConfig',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'get',
        params: params
    })
}

// 一键操作配置
export function setOperation(data) {
    return request({
        url: '/marketing/farmOperate/waterFertilizerCatchConfig',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'post',
        data
    })
}

//查询种子  listFarmSeed
export function listFarmSeed(params) {
    return request({
        url: '/marketing/farmOperate/listFarmSeed',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
            'pageNum': params.pageNum,
            'pageSize': params.pageSize
        },
        method: 'get',
        params: params
    })
}

// 添加种子 addFarmSeed
export function addFarmSeed(data) {
    return request({
        url: '/marketing/farmOperate/addFarmSeed',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'post',
        data
    })
}

// 修改种子
export function updateFarmSeed(data) {
    return request({
        url: '/marketing/farmOperate/updateFarmSeed',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'post',
        data
    })
}


//查询肥料  listMature
export function listMature(params) {
    return request({
        url: '/marketing/farmOperate/listMature',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
            'pageNum': params.pageNum,
            'pageSize': params.pageSize
        },
        method: 'get',
        params: params
    })
}

// 添加肥料 addFarmMature
export function addFarmMature(data) {
    return request({
        url: '/marketing/farmOperate/addFarmMature',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'post',
        data
    })
}

// 修改肥料
export function updateFarmMature(data) {
    return request({
        url: '/marketing/farmOperate/updateFarmMature',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'post',
        data
    })
}



//查询果实  listFruit
export function listFruit(params) {
    return request({
        url: '/marketing/farmOperate/listFruit',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
            'pageNum': params.pageNum,
            'pageSize': params.pageSize
        },
        method: 'get',
        params: params
    })
}

// 修改果实
export function updateFarmFruit(data) {
    return request({
        url: '/marketing/farmOperate/updateFarmFruit',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'post',
        data
    })
}


//获取农场规则  getFarmRule
export function getFarmRule(params) {
    return request({
        url: '/marketing/farmOperate/getFarmRule',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'get',
        params: params
    })
}

//设置农场规则  addFarmRule
export function addFarmRule(params) {
    return request({
        url: '/marketing/farmOperate/addFarmRule',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'post',
        data: params
    })
}